<%@ page import="entity.Emp" %>
<%@ page import="java.util.List" %>
<%@ page import="util.ParameterUtil" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/9/7
  Time: 19:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>修改员工</title>
</head>
<body>
<h1>修改员工信息</h1>
<a href="<%=request.getContextPath()%>/findAll.emp">返回员工列表</a>
<hr>
<%
    List<Emp> emps=(List<Emp>) request.getAttribute("emps");
    for(Emp emp:emps){

%>
<form action="<%=request.getContextPath()%>/modify.emp" method="post">
    编号:<input type="text" name="id" value="<%=emp.getId()%>" readonly><br>
    姓名:<input type="text" name="name" value="<%=emp.getName()%>"><br>
    工资:<input type="text" name="salary" value="<%=emp.getSalary()%>"><br>
    性别:<input type="radio" name="gender" value="man" <%="man".equals(emp.getGender())?"checked":""%>>男
    <input type="radio" name="gender" value="woman" <%="woman".equals(emp.getGender())?"checked":""%>>女<br>
    学历:
    <select name="edu">
        <option value="-1">请选择</option>
        <option value="1" <%="1".equals(emp.getEdu())?"selected":""%>>大专</option>
        <option value="2"  <%="2".equals(emp.getEdu())?"selected":""%>>本科</option>
        <option value="3"  <%="3".equals(emp.getEdu())?"selected":""%>>研究生</option>
        <option value="4"  <%="4".equals(emp.getEdu())?"selected":""%>>博士生</option>
    </select><br>
    兴趣:
    <input type="checkbox" name="hobbies" value="eat" <%=ParameterUtil.checkHobby(emp.getHob(),"eat")%>>吃饭
    <input type="checkbox" name="hobbies" value="sleep" <%=ParameterUtil.checkHobby(emp.getHob(),"eat")%>>睡觉
    <input type="checkbox" name="hobbies" value="beat" <%=ParameterUtil.checkHobby(emp.getHob(),"eat")%>>打豆豆<br>
    <input type="submit" value="修改">
</form>
<% } %>
</body>
</html>